package com.gupaoedu.pattern.singleton.threadlocal;

/**
 * 2019/5/11
 * created by chenpp
 */
public class ThreadLocalSingletonTest {
    public static void main(String[] args) {
        Thread thread = new Thread(new Runnable() {
            public void run() {
               ThreadLocalSingleton threadLocalSingleton = ThreadLocalSingleton.getInstance();
                System.out.println(Thread.currentThread().getName()+","+threadLocalSingleton);
            }
        });

        thread.start();
        Thread thread2 = new Thread(new Runnable() {
            public void run() {
                ThreadLocalSingleton threadLocalSingleton = ThreadLocalSingleton.getInstance();
                System.out.println(Thread.currentThread().getName()+","+threadLocalSingleton);
                ThreadLocalSingleton threadLocalSingleton2 = ThreadLocalSingleton.getInstance();
                System.out.println(Thread.currentThread().getName()+","+threadLocalSingleton2);
            }
        });
        thread2.start();
    }
}
